/** implementing circular move around the dial **/
var g_Element;
function fixPage() {
	console.log($("."+g_Element.id).children("h3").text());
	
	$(".page h3").text($("."+g_Element.id).children("h3").text());
	$(".page .content").html($("."+g_Element.id).children(".content").html());
	$(".page").css("visibility","visible");
	$(".page").addClass(g_Element.id);
}
function moveToPage() {
	
	$("div#dial-wrapper").css("display","none");
	console.log($("."+g_Element.id));
	fixPage();
	//$("."+g_Element.id).show("fold");
	
}
function onClickDial() {
	//console.log(this);
	console.log(PrefixFree.prefix+"animation","shrink 2s 1");
	//$("table").css(PrefixFree.prefix+"animation","shrink 2s 1");
	
	animate($("table"),	{
		name: "unradius",
		duration: "3s",
		iterationCount: "1",
		direction: "alternate"	
	});
	
	g_Element = this;
	var timeoutID = window.setTimeout(moveToPage, 3000);
};
function animate(e,options) {
	e.css(PrefixFree.prefix+"animation",options.name);
	e.css(PrefixFree.prefix+"animation-name",options.name);
	e.css(PrefixFree.prefix+"animation-duration",options.duration);
	e.css(PrefixFree.prefix+"animation-iteration-count",options.iterationCount);
	e.css(PrefixFree.prefix+"animation-direction",options.iterationCount);
}
$(function() {
	console.log(jQuery.browser);
	if(jQuery.browser["firefox"]) {
		
	}
	$("table span").click(onClickDial);
	
	
});